<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>SkeletonUtils - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
	<h1 translate="no">SkeletonUtils</h1>
		<section>
			<header>
			</header>
			<article>
				<h2 class="subsection-title">Import</h2>
				<p><span translate="no">SkeletonUtils</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
				<pre><code class="language-js">import * as SkeletonUtils from 'three/addons/utils/SkeletonUtils.js';</code></pre>
				<div class="container-overview">
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="~clone" translate="no">.<a href="#~clone">clone</a><span class="signature">( source : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Clones the given 3D object and its descendants, ensuring that any <code>SkinnedMesh</code> instances are
correctly associated with their bones. Bones are also cloned, and must be descendants of the
object passed to this method. Other data, like geometries and materials, are reused by reference.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>source</strong>
									</td>
									<td class="description last">
										<p>The 3D object to clone.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The cloned 3D object.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="~retarget" translate="no">.<a href="#~retarget">retarget</a><span class="signature">( target : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, source : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, options : <span class="param-type"><a href="module-SkeletonUtils.html#~RetargetOptions">module:SkeletonUtils~RetargetOptions</a></span> )</span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Retargets the skeleton from the given source 3D object to the
target 3D object.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>target</strong>
									</td>
									<td class="description last">
										<p>The target 3D object.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>source</strong>
									</td>
									<td class="description last">
										<p>The source 3D object.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>options</strong>
									</td>
									<td class="description last">
										<p>The options.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="~retargetClip" translate="no">.<a href="#~retargetClip">retargetClip</a><span class="signature">( target : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, source : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, clip : <span class="param-type"><a href="AnimationClip.html">AnimationClip</a></span>, options : <span class="param-type"><a href="module-SkeletonUtils.html#~RetargetOptions">module:SkeletonUtils~RetargetOptions</a></span> )</span><span class="type-signature"> : <a href="AnimationClip.html">AnimationClip</a></span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Retargets the animation clip of the source object to the
target 3D object.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>target</strong>
									</td>
									<td class="description last">
										<p>The target 3D object.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>source</strong>
									</td>
									<td class="description last">
										<p>The source 3D object.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>clip</strong>
									</td>
									<td class="description last">
										<p>The animation clip.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>options</strong>
									</td>
									<td class="description last">
										<p>The options.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The retargeted animation clip.</dt>
						</dl>
					</div>
				<h2 class="subsection-title">Type Definitions</h2>
				<div class="member">
					<h3 class="name" id="~RetargetOptions" translate="no">.<a href="#~RetargetOptions">RetargetOptions</a> </h3>
					<div class="description">
						<p>Retarget options of <code>SkeletonUtils</code>.</p>
					</div>
<table class="props">
	<tbody>
		<tr>
				<td class="name">
					<strong>useFirstFramePosition</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to use the position of the first frame or not.</p>
						<p>Default is <code>false</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>fps</strong>
						<br>
<span class="param-type">number</span>
				</td>
			<td class="description last">
				<p>The FPS of the clip.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>names</strong>
						<br>
<span class="param-type">Object.&lt;string, string></span>
				</td>
			<td class="description last">
				<p>A dictionary for mapping target to source bone names.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>getBoneName</strong>
						<br>
<span class="param-type">function</span>
				</td>
			<td class="description last">
				<p>A function for mapping bone names. Alternative to <code>names</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>trim</strong>
						<br>
<span class="param-type">Array.&lt;number></span>
				</td>
			<td class="description last">
				<p>Whether to trim the clip or not. If set the array should hold two values for the start and end.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>preserveBoneMatrix</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to preserve bone matrices or not.</p>
						<p>Default is <code>true</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>preserveBonePositions</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to preserve bone positions or not.</p>
						<p>Default is <code>true</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>useTargetMatrix</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to use the target matrix or not.</p>
						<p>Default is <code>false</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>hip</strong>
						<br>
<span class="param-type">string</span>
				</td>
			<td class="description last">
				<p>The name of the source's hip bone.</p>
						<p>Default is <code>'hip'</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>hipInfluence</strong>
						<br>
<span class="param-type"><a href="Vector3.html">Vector3</a></span>
				</td>
			<td class="description last">
				<p>The hip influence.</p>
						<p>Default is <code>(1,1,1)</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>scale</strong>
						<br>
<span class="param-type">number</span>
				</td>
			<td class="description last">
				<p>The scale.</p>
						<p>Default is <code>1</code>.</p>
			</td>
		</tr>
	</tbody>
</table>
				</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/SkeletonUtils.js" translate="no" target="_blank" rel="noopener">examples/jsm/utils/SkeletonUtils.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>